let env = ''
let appId = ''

// const uniInfo = (uni as any)?.getEnvInfoSync?.() || {}
// const envType = {
//     development: 'develop',
//     preview: 'trial',
//     production: 'release',
// }

const accountInfo = uni?.getAccountInfoSync?.() || {}

const systemInfo = uni?.getSystemInfoSync?.() || {}

env = accountInfo?.miniProgram?.envVersion || 'develop'

console.log(accountInfo?.miniProgram)

// #ifdef MP-ALIPAY
appId = accountInfo?.miniProgram?.appId || '2021004165689098'
// #endif

// #ifdef MP-WEIXIN
appId = accountInfo?.miniProgram?.appId || 'wx850e3a22db40acac'
// #endif

const platForm = systemInfo.uniPlatform || ''

const platform = systemInfo.uniPlatform === 'mp-alipay' ? 'ALIPAY' : 'WEIXIN'

const system = uni.getSystemInfoSync()

// 全局参数
const baseUrls = {
    // develop: 'http://192.168.110.188:8809',
    // develop: 'http://192.168.110.120:8809',
    // develop: 'http://192.168.110.120:8809',
    // develop: 'http://192.168.110.230:8809',
    // develop: 'https://blue.51zidan.com',
    develop: 'https://test.51zidan.com/testblue',
    // release: 'https://test.51zidan.com/testblue',
    release: 'https://blue.51zidan.com',
    trial: 'https://test.51zidan.com/testblue',
}

// 在h5对请求地址代理
// #ifdef H5
baseUrls.develop = '/api' // 具体请求地址修改VITE.CONFIG.TS
// #endif

export default {
    env,
    baseUrl: baseUrls[env as keyof typeof baseUrls],
    appId,
    zpUrl: '',
    session_key: '',
    areaCode: '',
    token: '',
    wechatGroup: 'https://work.weixin.qq.com/gm/00c7abf6b951631c446c85998d595d06',
    safeArea: system.safeAreaInsets,
    platForm,
    platform,
    qrCode: {},
    backUrl: '',
    companyId: 0,
    companyName: '',
    projectName: '',
    projectId: 0,
    homePath: '',
}
